package com.example.smartwaterapi.controller;

import com.example.smartwaterapi.common.api.RestApiResponse;
import com.example.smartwaterapi.entity.MenstrualCycle;
import com.example.smartwaterapi.service.MenstrualCycleService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 经期管理控制器
 */
@Tag(name = "经期管理API", description = "经期相关接口")
@RestController
@RequestMapping("/api/menstrual-cycle")
public class MenstrualCycleController {

    @Autowired
    private MenstrualCycleService menstrualCycleService;

    @Operation(summary = "获取经期详情", description = "根据ID获取经期信息")
    @GetMapping("/{id}")
    public RestApiResponse<MenstrualCycle> getMenstrualCycle(@Parameter(description = "ID") @PathVariable Long id) {
        MenstrualCycle cycle = menstrualCycleService.getById(id);
        if (cycle == null) {
            return RestApiResponse.notFound("经期记录不存在");
        }
        return RestApiResponse.ok(cycle);
    }

    // Add more endpoints

} 